/**
 * inforcreation.co.Ltd
 * 2011-10-31
 * @author MichaelHuang
 */
package com.zchat.api.modules;

import java.util.List;

import com.zchat.api.error.ZChatModuleManagerException;
import com.zchat.api.util.ZChatSetting;

/**
 * @author MichaelHuang
 * default module manager
 */
public interface ModuleManager {
	public static final String TAG = "ModuleManager";
	public static final boolean DEBUG = ZChatSetting.DEBUG;
	/**
	 * Add module into the module manager.If success,the manager will auto call the initialize method of the module.
	 * @param module
	 * @throws ZChatModuleManagerException
	 * @author MichaelHuang
	 */
	public void addModule(Module module) throws ZChatModuleManagerException;
	
	/**
	 * Remove the module from the module manager.
	 * @param module
	 * @throws ZChatModuleManagerException
	 * @author MichaelHuang
	 */
	public void removeModule(Module module) throws ZChatModuleManagerException;
	
	/**
	 * Return the moudule that name is equals clazz. Or null, if no module to fit.
	 * @param clazz
	 * @return
	 * @author MichaelHuang
	 */
	public Module getModule(Class clazz);
	
	/**
	 * Get the modules in the module manager.
	 * @return
	 * @author MichaelHuang
	 */
	public List<Module> getModules();
	
}
